package com.sunjob.mroassets.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@Configuration
@EnableSwagger2
public class AssetsSwaggerConfig {
    @Bean
    public Docket getDocket(){
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName("资产管理服务")//设置服务名
                .apiInfo(getapi())//服务内接口API接口信息
                .select().paths(PathSelectors.any())//选择服务下所有的接口
                .build();//通过上面的信息构造出Docket对象
    }
    public ApiInfo getapi(){
        return new ApiInfoBuilder().title("资产管理的接口文档")
                .version("v2022 0.0.1")
                .description("这是资产管理的接口文档")
                .contact(new Contact("jack","",""))
                .build();
    }
}
